package com.ecoolex.chinadutyfree.retailer.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   直邮产品限购策略<br>
 *<br>
 * 数据表： direct_mail_goods_product_buy_limit
 *
 */
@Description({"直邮产品限购策略"})
public class DirectMailGoodsProductBuyLimit implements Serializable {
    /**
     *
     *   主键    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Id
     */
    @Description({"主键", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer id;

    /**
     *
     *   直邮产品Id    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.DirectMailProductId
     */
    @Description({"直邮产品Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer directMailProductId;

    /**
     *
     *   单笔限购数量    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.SingleNumber
     */
    @Description({"单笔限购数量", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer singleNumber;

    /**
     *
     *   限购数量    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Number
     */
    @Description({"限购数量", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer number;

    /**
     *
     *   限购开始时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.StartTime
     */
    @Description({"限购开始时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date startTime;

    /**
     *
     *   限购结束时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.EndTime
     */
    @Description({"限购结束时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date endTime;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   主键    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置参数<br><br>
     *
     *   主键<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取参数<br><br>
     *
     *   直邮产品Id    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.DirectMailProductId
     */
    public Integer getDirectMailProductId() {
        return directMailProductId;
    }

    /**
     * 设置参数<br><br>
     *
     *   直邮产品Id<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.DirectMailProductId
     */
    public void setDirectMailProductId(Integer directMailProductId) {
        this.directMailProductId = directMailProductId;
    }

    /**
     * 获取参数<br><br>
     *
     *   单笔限购数量    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.SingleNumber
     */
    public Integer getSingleNumber() {
        return singleNumber;
    }

    /**
     * 设置参数<br><br>
     *
     *   单笔限购数量<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.SingleNumber
     */
    public void setSingleNumber(Integer singleNumber) {
        this.singleNumber = singleNumber;
    }

    /**
     * 获取参数<br><br>
     *
     *   限购数量    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Number
     */
    public Integer getNumber() {
        return number;
    }

    /**
     * 设置参数<br><br>
     *
     *   限购数量<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Number
     */
    public void setNumber(Integer number) {
        this.number = number;
    }

    /**
     * 获取参数<br><br>
     *
     *   限购开始时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.StartTime
     */
    public Date getStartTime() {
        return startTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   限购开始时间<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.StartTime
     */
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   限购结束时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.EndTime
     */
    public Date getEndTime() {
        return endTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   限购结束时间<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.EndTime
     */
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： direct_mail_goods_product_buy_limit.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        id("Id", "id", "INTEGER", false),
        directMailProductId("DirectMailProductId", "directMailProductId", "INTEGER", false),
        singleNumber("SingleNumber", "singleNumber", "INTEGER", false),
        number("Number", "number", "INTEGER", true),
        startTime("StartTime", "startTime", "TIMESTAMP", false),
        endTime("EndTime", "endTime", "TIMESTAMP", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}